home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office german / PROPLUS.WW / PROPLSWW.CAB / PPCORE.DLL / RCDATA / 5902 < prev    next >
Text File  |  2006-10-27  |  7KB  |  255 lines

  1. function FullScrInit()
  2. {
  3.     g_allowAdvOnClick = GetCurSld().mAdvOnClk
  4.     document.body.style.backgroundColor="black"
  5.     document.oncontextmenu=parent._CM;
  6.     document.onkeydown = _KDH;
  7.     document.ondragstart=Cancel
  8.     document.onselectstart=Cancel
  9.     self.focus()
  10. }
  11. function Redirect( frmId )
  12. {
  13.     var str=document.location.hash,idx=str.indexOf('#'), sId=GetSldId()
  14.     if(idx>=0) str=str.substr(1);
  15.     if( window.name != frmId && ( sId != str) ) {
  16.         obj = GetObj("Main-File")
  17.         window.location.href=obj.href+"#"+sId
  18.         return 1
  19.     }
  20.     return 0
  21. }
  22. var MHTMLPrefix = CalculateMHTMLPrefix();
  23. function CalculateMHTMLPrefix()
  24. {
  25.     if ( document.location.protocol == 'mhtml:') {
  26.         href=new String(document.location.href)
  27.         Start=href.indexOf('!')+1
  28.         End=href.lastIndexOf('/')+1
  29.         if (End < Start)
  30.             return href.substring(0, Start)
  31.         else
  32.         return href.substring(0, End)
  33.     }
  34.     return '';
  35. }
  36. function GetTags(base,tag)
  37. {
  38.     if(g_supportsPPTHTML) return base.all.tags(tag);
  39.     else return base.getElementsByTagName(tag);
  40. }
  41. function UpdNtsPane(){ if(frames["PPTNts"]) PPTNts.location.replace( MHTMLPrefix+GetHrefObj( gCurSld ).mNtsHref ) }
  42. function UpdNavPane( sldIndex ){ if(gNavLoaded) PPTNav.UpdNav() }
  43. function UpdOtNavPane(){ if(gOtlNavLoaded) PPTOtlNav.UpdOtlNav() }
  44. function UpdOtlPane(){ if(gOtlLoaded) PPTOtl.UpdOtl() }
  45. function SetHasNts( fVal )
  46. {
  47.     if( gHasNts != fVal ) {
  48.         gHasNts=fVal
  49.         UpdNavPane()
  50.     }
  51. }
  52. function ToggleOtlText()
  53. {
  54.     gOtlTxtExp=!gOtlTxtExp
  55.     UpdOtlPane()
  56. }
  57. function ClearMedia()
  58. {
  59.     if (PPTSld.pptSound) PPTSld.pptSound.loop = 0;
  60. }
  61. function FullScreen()
  62. {
  63.     if ( PPTSld.g_animUseRuntime )
  64.         PPTSld.document.body.pause();
  65.     ClearMedia();
  66.     var href = ( document.location.protocol == 'mhtml:') ? FULLSCR_HREF : FULLSCR_HREF+"#"+GetHrefObj(gCurSld).mSldHref;
  67.     if(PPTNav.event.ctrlKey) {
  68.         var w = (window.screen.availWidth * 1.0) / 2.0
  69.         var h = w * (PPTSld.g_origH * 1.0) / PPTSld.g_origW
  70.         win = window.open( MHTMLPrefix+href,null,"toolbar=0,resizable=1,top=0,left=0," + "width="+ w + ",height=" + h );
  71.         if( win.document.body && PPTSld.g_animUseRuntime )
  72.             win.document.body.PPTSldFrameset=window;
  73.     }
  74.     else
  75.     {
  76.         win = window.open( MHTMLPrefix+href,null,"fullscreen=yes" );
  77.         if( win.document.body && PPTSld.g_animUseRuntime )
  78.             win.document.body.PPTSldFrameset=window;
  79.     }
  80. }
  81. function ToggleVNarration()
  82. {
  83.     rObj=PPTSld.document.all("NSPlay")
  84.     if( rObj && !PPTSld.g_animUseRuntime ) {
  85.         if( (rObj.playState == 1)||(rObj.playState == 0) )
  86.             rObj.Play()
  87.         else if( rObj.playState == 2 )
  88.             rObj.Pause()
  89.         else
  90.             return;
  91.     }
  92.     else if( PPTSld.g_animUseRuntime )
  93.     {
  94.         narObj = PPTSld.document.all("narrationID")
  95.         if( narObj )
  96.             narObj.togglePause()
  97.     }
  98. }
  99. function GetCurSldNum()
  100. {
  101.     obj=GetHrefObj(gCurSld)
  102.     if( obj.mOrigVis == 1 )
  103.         return obj.mSldIdx
  104.     else
  105.         return gCurSld
  106. }
  107. function GetNumSlds()
  108. {
  109.     if( GetHrefObj(gCurSld).mOrigVis == 1 )
  110.         return GetSldList().mNumVisSlds;
  111.     else
  112.         return GetSldList().mList.length
  113. }
  114. function GetSldNum( href )
  115. {
  116.     for(ii=0; ii<GetSldList().mList.length; ii++) {
  117.         if ( GetSldList().mList[ii].mSldHref == href )
  118.             return ii+1
  119.     }
  120.     return 1
  121. }
  122. function GetHrefObj( sldIdx ){ return GetSldList().mList[sldIdx-1] }
  123. function IsFramesMode(){ return ( SCREEN_MODE == "Frames" ) }
  124. function IsFullScrMode(){ return ( SCREEN_MODE == "FullScreen" ) }
  125. function GoToNextSld()
  126. {
  127.     ii=gCurSld + 1
  128.     if( GetHrefObj( ii-1 ).mOrigVis == 0 ) {
  129.         if( ii<=GetSldList().mList.length ) {
  130.             obj=GetHrefObj(ii)
  131.             obj.mVis=1
  132.             GoToSldNum(ii)
  133.             return
  134.         }
  135.     }
  136.     else {
  137.         obj=GetHrefObj( ii )
  138.         while ( obj && ( obj.mOrigVis == 0 ) )
  139.             obj=GetHrefObj(++ii)
  140.         if( obj && obj.mOrigVis ) {
  141.             GoToSldNum(ii)
  142.             return
  143.         }
  144.     }
  145.     if( gSldStack.length > 1 )
  146.         PopSldList();
  147.     else if( !IsFramesMode() ) {
  148.         if( gLoopCont )
  149.             GoToFirst()
  150.         else
  151.             EndShow()
  152.     }
  153. }
  154. function GoToPrevSld()
  155. {
  156.     ii=gCurSld-1
  157.     if( ii > 0 ) {
  158.         obj=GetHrefObj(ii)
  159.         while ( obj && ( obj.mVis == 0 ) && ( ii>0 ) )
  160.             obj=GetHrefObj(--ii)
  161.         if( ii == 0 ) ii=1
  162.             GoToSldNum(ii)
  163.     }
  164. }
  165. function GoToFirst(){ GoToSld( GetHrefObj(1).mSldHref ) }
  166. function GoToLast()
  167. {
  168.     ii=GetSldList().mList.length
  169.     if( ii != gCurSld )
  170.         GoToSld( GetHrefObj(ii).mSldHref )
  171. }
  172. function GoToSldNum( num )
  173. {
  174.     if( PPTSld.event ) PPTSld.event.cancelBubble=true
  175.     obj = GetHrefObj( num )
  176.     obj.mVis=1
  177.     gPrevSld=gCurSld
  178.     gCurSld = num;
  179.     PPTSld.location.replace(MHTMLPrefix+obj.mSldHref)
  180.     if( IsFramesMode() ) {
  181.         UpdNavPane(); UpdOtlPane(); UpdNtsPane()
  182.     }
  183. }
  184. function GoToSld( href )
  185. {
  186.     if( PPTSld.event ) PPTSld.event.cancelBubble=true
  187.     GetHrefObj( GetSldNum(href) ).mVis=1
  188.     PPTSld.location.replace(MHTMLPrefix+href)
  189. }
  190. function SldUpdated( id )
  191. {
  192.     if( id == GetHrefObj(gCurSld).mSldHref ) return
  193.     gPrevSld=gCurSld
  194.     gCurSld=GetSldNum(id)
  195.     if( IsFramesMode() ) {
  196.         UpdNavPane(); UpdOtlPane(); UpdNtsPane()
  197.     }
  198. }
  199. function PrevSldViewed(){ GoToSld( GetHrefObj(gPrevSld).mSldHref ) }
  200. function HasPrevSld() { return ( gIsEndShow || ( gCurSld != 1 && GetHrefObj( gCurSld-1 ).mVis == 1 )||( GetCurSldNum() > 1 ) ) }
  201. function HasNextSld() { return (GetCurSldNum() != GetNumSlds()) }
  202. function CloseWindow() {
  203.     if( HideMenu() ) return;
  204.     var event = PPTSld.event;
  205.     if( !IsFramesMode() && event && (event.keyCode==27 || event.keyCode==32 || event.type=="click" ) )
  206.         window.close( self );
  207.     CatchNumKeys( self, event );
  208. }
  209. function Unload() { gIsEndShow=0; }
  210. function SetupEndShow() {
  211.     gIsEndShow=1;
  212.     PPTSld.document.body.scroll="no";
  213.     PPTSld.document.onkeypress=CloseWindow;
  214.     PPTSld.document.onclick=CloseWindow;
  215.     PPTSld.document.oncontextmenu=_CM;
  216. }
  217. function EndShow()
  218. {
  219.     if( IsFramesMode() ) return
  220.     if( PPTSld.event ) PPTSld.event.cancelBubble=true
  221.     doc=PPTSld.document
  222.     var dir = doc.body.dir
  223.     if( dir != "rtl" ) dir = "ltr";
  224.     doc.open()
  225.     doc.writeln('<html><body dir=' + dir + ' bgcolor=black onload=parent.SetupEndShow() onunload=parent.Unload()><center><p><font face=Tahoma color=white size=2><br><b>' + ENDSHOW_MESG + '</b></font></p></center></body></html>')
  226.     doc.close()
  227. }
  228. function SetSldVisited(){ GetSldList().mList[gCurSld-1].mVisited=true }
  229. function IsSldVisited(){ return GetSldList().mList[gCurSld-1].mVisited }
  230. function hrefList( sldHref, visible, advDelay, advClk )
  231. {
  232.     this.mSldHref= this.mNtsHref = sldHref
  233.     this.mOrigVis= this.mVis = visible
  234.     this.mVisited= false
  235.     this.mAdvDelay= advDelay
  236.     this.mAdvOnClk= advClk
  237. }
  238. function SldList(arr,curSld,fEnd)
  239. {
  240.     this.mCurSld = curSld;
  241.     this.mList = new Array();
  242.     var idx = 1;
  243.     for(ii=0;ii<arr.length;ii++) {
  244.         this.mList[ii] = new hrefList( arr[ii].mSldHref, arr[ii].mOrigVis, arr[ii].mAdvDelay, arr[ii].mAdvOnClk );
  245.         if( arr[ii].mOrigVis )
  246.             this.mList[ii].mSldIdx = idx++;
  247.     }
  248.     this.mNumVisSlds = idx-1;
  249.     this.fEndShow = fEnd;
  250. }
  251. function GetSldList() {    return gSldStack[gSldStack.length-1] }
  252. function GetCurSld() { return parent.GetSldList().mList[parent.gCurSld - 1] }
  253. gSldStack = new Array();
  254. gSldStack[0] = new SldList(gMainDoc,gCurSld,1)
  255.